package com.example.graduation.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.io.File;
import java.io.IOException;

/**
 * @author Jeffery
 * Resource工具类
 */
@Service
@Slf4j(topic = "ResourceUtil")
public class ResourceUtil {

    /**
     * 获取Resource文件夹下  file文件夹路径
     *
     * @return filePath
     */
    public String getFile() {
        File directory = null;
        String reportPath = "";
        try {
            directory = new File("src/main/resources/file");
            reportPath = directory.getCanonicalPath();
        } catch (IOException e) {
            log.info("发生异常了 : {}", e.getMessage());
        }
        return reportPath;
    }
}
